package com.dudy.common.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * @program: nacos_auth
 * author: dudy
 * create: 2020-11-03 20:15
 * description: 日志拦截器
 **/
@Aspect
@Component
public class LogAop {

	private static final Logger logger = LoggerFactory.getLogger(LogAop.class);

	/**
	 * 以 controller 或 publish 包下定义的所有请求为切入点
	 */
	@Pointcut("execution(public * *.controller..*.*(..)) || execution(public * *.publish..*.*(..))")
	public void addLog() {
	}

	@Test
	public void test(){
		LocalDateTime of = LocalDateTime.of(2020, 06, 30,00,00,00);
		System.out.println(of.toInstant(ZoneOffset.of("+8")).toEpochMilli());
	}
}
